Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(py_wheel): Added requires_file and extra_requires_files attrs #1710

Merged
merged 1 commit into from
Jan 23, 2024

Conversation

UebelAndre
Copy link
Contributor

The compile_pip_requirements rule promotes having requirements.in files describe python dependencies. This change aims to allow these files to be the source of truth for constraints by allowing the py_wheel rule to use them for adding requirements to a wheel. This reduces overhead in needing to maintain two lists of equal information (one as he .in and the other as starlark data).

@UebelAndre
Copy link
Contributor Author

Relates to #644

@UebelAndre UebelAndre force-pushed the requires branch 2 times, most recently from 368ef11 to 40890e2 Compare January 20, 2024 19:33
Copy link
Collaborator

@aignas aignas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR.

One more usecase which comes to my mind that this PR enables is to have a consistent wheel built with classic pyproject.toml which reads the requires directives from files (which is an example in pip-tools repo) and the rules_python packaging rule. I am not sure if this would be useful to someone, but this interop possibility is nice in its own right.

CHANGELOG.md Outdated Show resolved Hide resolved
examples/wheel/wheel_test.py Outdated Show resolved Hide resolved
python/private/py_wheel.bzl Show resolved Hide resolved
python/private/py_wheel.bzl Outdated Show resolved Hide resolved
python/private/py_wheel.bzl Outdated Show resolved Hide resolved
tools/wheelmaker.py Outdated Show resolved Hide resolved
python/private/py_wheel.bzl Show resolved Hide resolved
@UebelAndre
Copy link
Contributor Author

@aignas ready for another pass! 😄

Copy link
Collaborator

@aignas aignas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly LGTM, thanks for the improvements!

tools/wheelmaker.py Outdated Show resolved Hide resolved
python/private/py_wheel.bzl Show resolved Hide resolved
@UebelAndre
Copy link
Contributor Author

@aignas ready for another pass! 😄

Copy link
Collaborator

@aignas aignas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, minus the changelog part

CHANGELOG.md Outdated Show resolved Hide resolved
@aignas aignas enabled auto-merge January 23, 2024 00:20
@UebelAndre

This comment was marked as outdated.

@aignas aignas added this pull request to the merge queue Jan 23, 2024
@UebelAndre

This comment was marked as outdated.

@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Jan 23, 2024
@UebelAndre
Copy link
Contributor Author

@aignas I rebased since I didn't understand what was up with the merge queue.

@aignas aignas enabled auto-merge January 23, 2024 02:45
@aignas aignas added this pull request to the merge queue Jan 23, 2024
Merged via the queue into bazelbuild:main with commit 5b164a2 Jan 23, 2024
4 checks passed
@UebelAndre UebelAndre deleted the requires branch January 23, 2024 06:29
github-merge-queue bot pushed a commit that referenced this pull request Jan 24, 2024
)

The `requires_file` and `extra_requires_files` attributes added by
#1710 break wheels by
leaving trailing `;` and currently do not support `requirements.in`
files with comments following a constraint on the same line. This PR
fixes these issues.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants